package cn.chenc.framework.jpa.jdbc;

import cn.chenc.framework.jpa.exception.RepositoryException;
import cn.chenc.framework.jpa.model.PageInfo;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;
import java.util.Map;

/**
 * 　@description: TODO
 * 　@author secret
 * 　@date 2021/7/21 22:07
 *
 */
public interface BaseJdbcTemplate {

    List<Map<String, Object>> queryListMapBySql(String sql) throws Exception;

    PageInfo queryListMapBySql(String sql, PageInfo page) throws Exception;

    PageInfo queryListMapNoTotalBySql(String sql, PageInfo page) throws Exception;

    <T> List<T> queryListEntityBySql(String sql, Class<T> mappedClass) throws Exception;

    <T> PageInfo queryListEntityBySql(String sql, Class<T> mappedClass, PageInfo page) throws Exception;

    Map<String, Object> queryMapBySql(String sql) throws Exception;

    JdbcTemplate queryJdbcTemplate() throws Exception;

    void execute(String sql) throws Exception;

    <T> T queryEntityBySql(String sql, Class<T> mappedClass) throws Exception;

    List<Map<String, String>> getColumnsAndTypeBySql(String sql) throws RepositoryException;

    List<String> getColumnsBySql(String sql) throws RepositoryException;

}
